<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style>
			*{margin: 0px;
			padding: 0px;}
			img{width: 300px;
			height: 400px;}
			.div{width: 50px;
			height: 50px;background-color: aqua;}
		</style>
		<script>
			i=1
			
			function zdlb()
			{
			i=i+1
			if(i==6)
			i=1
			a=document.getElementById("yyqx");
			a.src=i+".jpg";
			setTimeout("zdlb()",2000);
			}
			function pre()
			{
				i=i-1;
				if(i==0)
				  i=5;
				  a=document.getElementById("yyqx");
				  a.src=i+".jpg";
			}
			function next()
			{
				i=i+1;
				if(i==6)
				  i=1;
				  a=document.getElementById("yyqx");
				  a.src=i+".jpg";
			}
		</script>
	</head>
	<body onload="zdlb()">
		<img src="1.jpg" id="yyqx" /><br />
		<input type="button" value="上一张" onclick="pre()" />
		<input type="button" value="下一张" onclick="next()" />
	</body>
</html>
